
#ifndef __JRMJExtensionConst__H__
#define __JRMJExtensionConst__H__

#import <Foundation/Foundation.h>

// 过期
#define JRMJExtensionDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead)

// 构建错误
#define JRMJExtensionBuildError(clazz, msg) \
NSError *error = [NSError errorWithDomain:msg code:250 userInfo:nil]; \
[clazz setJRMJ_error:error];

// 日志输出
#ifdef DEBUG
#define JRMJExtensionLog(...) NSLog(__VA_ARGS__)
#else
#define JRMJExtensionLog(...)
#endif

/**
 * 断言
 * @param condition   条件
 * @param returnValue 返回值
 */
#define JRMJExtensionAssertError(condition, returnValue, clazz, msg) \
[clazz setJRMJ_error:nil]; \
if ((condition) == NO) { \
    JRMJExtensionBuildError(clazz, msg); \
    return returnValue;\
}

#define JRMJExtensionAssert2(condition, returnValue) \
if ((condition) == NO) return returnValue;

/**
 * 断言
 * @param condition   条件
 */
#define JRMJExtensionAssert(condition) JRMJExtensionAssert2(condition, )

/**
 * 断言
 * @param param         参数
 * @param returnValue   返回值
 */
#define JRMJExtensionAssertParamNotNil2(param, returnValue) \
JRMJExtensionAssert2((param) != nil, returnValue)

/**
 * 断言
 * @param param   参数
 */
#define JRMJExtensionAssertParamNotNil(param) JRMJExtensionAssertParamNotNil2(param, )

/**
 * 打印所有的属性
 */
#define JRMJLogAllIvars \
-(NSString *)description \
{ \
    return [self JRMJ_keyValues].description; \
}
#define JRMJExtensionLogAllProperties JRMJLogAllIvars

/**
 *  类型（属性类型）
 */
extern NSString *const JRMJPropertyTypeInt;
extern NSString *const JRMJPropertyTypeShort;
extern NSString *const JRMJPropertyTypeFloat;
extern NSString *const JRMJPropertyTypeDouble;
extern NSString *const JRMJPropertyTypeLong;
extern NSString *const JRMJPropertyTypeLongLong;
extern NSString *const JRMJPropertyTypeChar;
extern NSString *const JRMJPropertyTypeBOOL1;
extern NSString *const JRMJPropertyTypeBOOL2;
extern NSString *const JRMJPropertyTypePointer;

extern NSString *const JRMJPropertyTypeIvar;
extern NSString *const JRMJPropertyTypeMethod;
extern NSString *const JRMJPropertyTypeBlock;
extern NSString *const JRMJPropertyTypeClass;
extern NSString *const JRMJPropertyTypeSEL;
extern NSString *const JRMJPropertyTypeId;

#endif
